package com.tool4j.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 代码生成模板信息表
 *
 * @author Deng.Weiping
 * @since 2023-11-24 09:02:30
 */
@Data
@TableName("t_template_info")
public class TemplateInfo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 模板名称
     */
    private String templateName;

    /**
     * 路径
     */
    private String path;

    /**
     * orm框架
     */
    private String ormType;

    /**
     * 所属用户
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createdDate;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date updatedDate;

    /**
     * 模板文件
     */
    @TableField(exist = false)
    private List<TemplateFile> files;

    /**
     * 基础模板ID
     */
    @TableField(exist = false)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long baseTemplate;

}